from funasr import AutoModel
from funasr.utils.postprocess_utils import rich_transcription_postprocess

from funasr.utils.postprocess_utils import rich_transcription_postprocess


model_dir = "iic/SenseVoiceSmall"
model = AutoModel(model=model_dir, trust_remote_code=True, device="cuda:0")

res = model.generate(
    input="ko.mp3",
    cache={},
    language="auto", # "zn", "en", "yue", "ja", "ko", "nospeech"
    use_itn=True,
    batch_size=64,
)
print(res)
text = rich_transcription_postprocess(res[0]["text"])
print(text)